package com.yiren.backstage.judge.bean;

import com.yiren.backstage.currency.entity.ProjectJudgeEntity;

import java.io.Serializable;
import java.util.List;

/**
 * Time:2021/11/11 11:41
 * Author:xiaozan
 * Description:评判节点对象
 */
public class NodeBean implements Serializable {

    private static final long serialVersionUID = -2721191232926604726L;

    /*** id */
    private String id;

    /*** 父级ID */
    private String parentId;

    /*** 父级节点 */
    private NodeBean parent;

    /*** 子级节点集合 */
    private List<NodeBean> children;

    /*** 名称 */
    private String name;

    /*** 当前节点对象（评判详情） */
    private Object entity;

    /*** 所属项目队列对象 */
    private ProjectJudgeEntity projectJudgeEntity;

    public NodeBean() {
        super();
    }

    public NodeBean(String id, String parentId, String name, Object entity, ProjectJudgeEntity projectJudgeEntity) {
        super();
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.entity = entity;
        this.projectJudgeEntity = projectJudgeEntity;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public NodeBean getParent() {
        return parent;
    }

    public void setParent(NodeBean parent) {
        this.parent = parent;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<NodeBean> getChildren() {
        return children;
    }

    public void setChildren(List<NodeBean> children) {
        this.children = children;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        NodeBean other = (NodeBean) obj;
        if (id != other.id)
            return false;
        if (parentId != other.parentId)
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "Node {id=" + id + ", parentId=" + parentId + ", children="
                + children + ", name=" + name + "}";
    }

    public Object getEntity() {
        return entity;
    }

    public ProjectJudgeEntity getProjectJudgeEntity() {
        return projectJudgeEntity;
    }

    public void setEntity(Object entity) {
        this.entity = entity;
    }

}